package net.sansi.v3correctserver.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import net.sansi.v3correctserver.dto.R;
import net.sansi.v3correctserver.dto.correct.ChromaCorrectDto;
import net.sansi.v3correctserver.service.correct.ChromaCorrectService;
import net.sansi.v3correctserver.task.ChromaCorrectTask;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;

/**
 * Created by Fang
 * create time : 2024/11/5
 * IDE : IntelliJ IDEA
 * <p>
 * 色度矫正接口
 */

@Api(tags = "色度矫正")
@RestController
@RequestMapping("/chroma-correct")
@Validated
public class ChromaCorrectController {
    @Resource
    private ChromaCorrectService chromaCorrectService;

    /**
     * 矩形屏色度矫正（返回任务ID）
     *
     * @param form 请求参数
     * @return 任务ID
     */
    @ApiOperation("矩形屏色度矫正（返回任务ID）")
    @PostMapping("/rect/start")
    public R<String> rectAuto(@RequestBody @Validated ChromaCorrectDto.RectStartReq form) {
        // TODO 矩形屏测度矫正
        return null;
    }

    /**
     * 查询矩形屏色度矫正任务进度
     *
     * @param taskId 任务id
     * @return 色度矫正进度
     */
    @ApiOperation("查询矩形屏色度矫正任务进度")
    @GetMapping("/rect/progress")
    public R<ChromaCorrectTask.CorrectProgress> rectProgress(@RequestParam("taskId") @NotBlank() String taskId) {
        // TODO 查询矩形屏色度矫正任务进度
        return null;
    }
}
